<%@ page import="service.serviceimpl.ServiceImpl" %><%--
  Created by IntelliJ IDEA.
  User: Root404
  Date: 2023/5/11
  Time: 10:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String name = request.getParameter("name");
    ServiceImpl service = new ServiceImpl();
    int load = service.load("select  count(1) from t163 where name=?", name);
    if(load>0){
        session.setMaxInactiveInterval(60);
        session.setAttribute("user",name);
        Cookie user = new Cookie("user", name);
        user.setMaxAge(60);
        response.addCookie(user);
        request.getRequestDispatcher("main.jsp").forward(request,response);

    }else{
        response.sendRedirect("login.jsp?isload=f");
    }

%>

</body>
</html>
